import java.util.ArrayList;
import java.util.List;


public class User implements subject{
    private List<observer> observers = new ArrayList<observer>();
    private String _name;
    public User(String name){
        this._name = name;
    }
    @Override
    public void attach(observer observer) {
        observers.add(observer);
    }

    @Override
    public void remove(observer observer) {
        observers.remove(observer);
    }


    @Override
    public void notifyObserve(String message) {
        for (observer o:observers){
            o.update(message);
        }
    }
}